home *** CD-ROM | disk | FTP | other *** search
- package horst;
-
- import java.awt.Rectangle;
-
- public class NBSPView extends View {
- public NBSPView(View parent, Element e, HTMLPane container) {
- super(parent, e, container);
- }
-
- protected int getMinimumSpan(int axis) {
- return this.getPreferredSpan(axis);
- }
-
- protected int getPreferredSpan(int axis) {
- return axis == 1 ? super.m_prefWidth : super.m_prefHeight;
- }
-
- protected void init() {
- super.m_prefWidth = ((View)this).getFontMetrics().stringWidth(" ");
- super.m_prefHeight = ((View)this).getFontMetrics().getAscent();
- super.m_minWidth = super.m_prefWidth;
- super.m_minHeight = super.m_prefHeight;
- }
-
- protected void invalidate() {
- for(View parent = super.m_parent; parent != null; parent = parent.m_parent) {
- parent.invalidate();
- }
-
- }
-
- boolean isNoBreakSpace() {
- return true;
- }
-
- protected Rectangle layout(int x, int y, int width, LayoutInfo info) {
- super.m_bounds.setBounds(x, y, this.getPreferredSpan(1), this.getPreferredSpan(0));
- return super.m_bounds;
- }
- }
-